/**
 * JAVACC DEMO 1.0
 * @copy right iussoft company All rights reserved.
 * @Package com.apache.uct.service.plugins  
 */
package com.apache.uct.service.plugins;

import com.apache.api.manager.PluginConnector;
import com.apache.api.manager.ProxyManager;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.cache.util.Validator;

public class OrgDelPlugin implements PluginConnector {

	private ProxyManager uctProxyManager;

	public Object execute(ParamsVo vo) throws Exception {
		ResultEntity entity = new ResultEntity();
		entity.setMessage("删除成功");
		entity.setResult("true");
		String id = String.valueOf(vo.getParams("orgId"));
		if (Validator.isNotNull(id)) {
			vo.setInfoId(id);
			vo.setKey("deleteOrg");
			vo.setParams("infoType", "org");
			String msg = String.valueOf(uctProxyManager.doInvoke(vo));
			if (Validator.isNotNull(msg)) {
				entity.setMessage(msg);
			}
		} else {
			entity.setMessage("请选择要删除的机构！");
			entity.setResult("false");
		}
		entity.setEntity(id);
		return entity;
	}

	public void setUctProxyManager(ProxyManager uctProxyManager) {
		this.uctProxyManager = uctProxyManager;
	}

}
